/**
 * CSS Reset
 * 重置浏览器默认样式，提供一致的基础样式
 */

/* 重置所有元素的内外边距和盒模型 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 重置HTML和body的基础样式 */
html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #333;
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 重置标题样式 */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 500;
  line-height: 1.2;
  color: inherit;
}

/* 重置段落样式 */
p {
  margin: 0;
}

/* 重置链接样式 */
a {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
}

a:hover {
  color: inherit;
  /* text-decoration: none; */
  text-decoration: underline;
}

/* 重置图片样式 */
img {
  max-width: 100%;
  height: auto;
  text-align: center;
  vertical-align: middle;
  border-style: none;
}

/* 重置表单元素样式 */
input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
  padding: 0;
}

input[type="radio"],
input[type="checkbox"] {
  box-sizing: border-box;
  padding: 0;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
select,
textarea {
  border: 1px solid #ddd;
  border-radius: 0;
  outline: none;
  transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  border-color: #40a9ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

button {
  cursor: pointer;
  border: none;
  background-color: transparent;
  outline: none;
}

/* 重置列表样式 */
ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 重置表格样式 */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 重置块引用样式 */
blockquote {
  margin: 0;
  padding: 0;
}

/* 重置hr样式 */
hr {
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid #eee;
}

/* 重置代码样式 */
code, pre {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1em;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* 重置滚动条样式（Webkit浏览器） */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 重置选中文本样式 */
::selection {
  background-color: #b3d4fc;
  color: inherit;
}

::-moz-selection {
  background-color: #b3d4fc;
  color: inherit;
}

/* 确保所有元素的基线对齐 */
sub, sup {
  position: relative;
  font-size: 75%;
  line-height: 0;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

/* 确保隐藏元素完全隐藏 */
[hidden] {
  display: none !important;
}

/* 确保绝对定位的元素不会溢出 */
.abs-full {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 辅助类：清除浮动 */
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}